<?php
/**
 * Created by PhpStorm.
 * User:tsingStar
 * Date: 2020/6/16
 * Time: 11:19
 */

require_once __DIR__."/WxPay.Config.Interface.php";
class WxPayConfig extends WxPayConfigInterface
{
    private $setting = [];

    public function __construct()
    {
        $this->setting = config('app.weixin');
    }

    /**
     * @inheritDoc
     */
    public function GetAppId()
    {
        return $this->setting['app_id'];
    }

    public function GetMerchantId()
    {
        return $this->setting['mch_id'];
    }

    /**
     * @inheritDoc
     */
    public function GetNotifyUrl()
    {
        return $this->setting['notify_url'];
    }

    public function GetSignType()
    {
        return 'MD5';
    }

    /**
     * @inheritDoc
     */
    public function GetProxy(&$proxyHost, &$proxyPort)
    {
        // TODO: Implement GetProxy() method.
    }

    /**
     * @inheritDoc
     */
    public function GetReportLevenl()
    {
        // TODO: Implement GetReportLevenl() method.
    }

    public function GetKey()
    {
        return $this->setting['api_key'];
    }

    public function GetAppSecret()
    {
        return $this->setting['app_secret'];
    }

    /**
     * @inheritDoc
     */
    public function GetSSLCertPath(&$sslCertPath, &$sslKeyPath)
    {
        $sslCertPath = $this->setting['ssl_cert_path'];
        $sslKeyPath = $this->setting['ssl_key_path'];
    }

    public function SetKey($api_key)
    {
        $this->setting['api_key'] = $api_key;
    }

    public function SetAppSecret($secret)
    {
        $this->setting['app_secret'] = $secret;
    }
}